<?php
include "DBConnectMenu.php";
include "funcoes.php";

$pagina = $_REQUEST['pagina'];
$strSQL = "";
$i		= 0;

$strSQL = " SELECT id_menu, pagina FROM menu_item WHERE pagina LIKE '%$pagina'	";
$ObjMenu = execute($strSQL);

$i = mysql_num_rows($ObjMenu);

if($i > 0){
	while($menu = mysql_fetch_array($ObjMenu)){?>
	<script type="text/javascript" language="javascript">
		window.parent.left.location.href = "menu_left.php?id_menu=<?echo $menu['id_menu']?>&pagina=<?echo $menu['pagina']?>";
		window.parent.content.location.href = "<?echo $menu['pagina']?>";
	</script>
	<?}
}else{
	header('Location: erro.php?texto=Ocorreu um erro ao acessar os dados do menu.<br/>Por favor, efetue o login e tente novamente, se o problema persistir entre em contato com o administrador.&voltar=N');
}
?>